Page 1

Row

Edad media

52.8

Nivel de preocupación general por el cambio climático

Algo preocupado

Nivel de responsabilidad hacia la reducción del cambio climático

Alta

Row

Distribución por Género

Distribución por Nivel de Educación

---
title: "Creencias, actitudes y valores hacia el cambio climático"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
    social: menu
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(plotly)
library(leaflet)
```
Page 1
=====================================

Row {data-height=50}
-----------------------------------------------------------------------

### Edad media

```{r}
edad_media <- 52.8
valueBox(edad_media, "Media de Edad", icon = "fa-users", color = "#AFEEEE")
```
### Nivel de preocupación general por el cambio climático
```{r}
preocupacion_mas_frecuente <- "Algo preocupado"
valueBox(preocupacion_mas_frecuente, "Preocupación por el cambio climático", icon = "fa-leaf", color = "#AFEEEE")
```
### Nivel de responsabilidad hacia la reducción del cambio climático
```{r}
responsabilidad_mas_frecuente <- "Alta"
valueBox(responsabilidad_mas_frecuente, "Responsabilidad para reducir el cambio climático", icon = "fa-hand-paper", color = "#AFEEEE")
```

Row {data-height=50}
-----------------------------------------------------------------------

### Distribución por Género


```{r}

data <- tibble(
  Gender = c("Male", "Female"),
  Count = c(10271, 11919)
)

plot_ly(data, labels = ~Gender, values = ~Count, type = 'pie', 
        textinfo = 'label+percent', insidetextorientation = 'radial',
        marker = list(colors = c('#B0C4DE', '#D8BFD8')))

```

### Distribución por Nivel de Educación

```{r}

education_data <- tibble(
  Education = c("Bajo", "Medio", "Alto"),
  Count = c(4911, 4337, 1771)
)

# Crear el gráfico de sectores con un gradiente de colores animado
plot_ly(education_data, labels = ~Education, values = ~Count, type = 'pie', 
        textinfo = 'label+percent', insidetextorientation = 'radial',
        marker = list(colors = c('#FFB6C1', '#FF69B4', '#FF1493')))
```